<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>
<script type="text/javascript">
    $(function(){
    
        $.datepicker.setDefaults( $.datepicker.regional[ "zh-CN" ] );
        $( "#form1 #dateinbegin" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
        $( "#form1 #dateinend" ).datepicker({
            changeMonth: true,
            changeYear: true
        });
    });
</script>
<div style=" padding:2px; margin:2px;color: #c00;" id='sel'><?php echo $this->nowYm;?>的代购统计数据</div>
<form action="/admini/manageday/buyshopcount/" method="get" style="margin:0px" id="form1">
    <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;" id='sel'>
        <label for="starttime">时间：</label><input type="text" id="dateinbegin" name="dateinbegin" value="<?php echo $this->dateinbegin; ?>" />
        <label for="endtime">--</label><input type="text" id="dateinend" name="dateinend" value="<?php echo $this->dateinend; ?>" />
        <input type="submit" id="queryButton" value="查询"/>
    </div>
</form>
    <div class="dataTable">
        <table>  
            <tfoot>
             <tr><td colspan="14"><button class="button" id="cvs-button" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;">导出csv</button></td></tr>
            </tfoot>
            <tr>
                <th class="w1" width="10%">时间</th>
                <th class="w2" width="10%">代购总数量</th>
                <th class="w3" width="10%">总收金额</th>	
                <th class="w4" width="10%">运费</th>	
                <th class="w5" width="10%">部分退款</th>
            </tr>  
        
            <?php if($this->countdata != ''){
                foreach ($this->countdata as $key => $Item) { ?> 
                <tr>
                    <td class="w1" nowrap align="center"><?php echo date("Y-m-d",$key); ?></td>
                    <td class="w2" nowrap align="center"><?php echo $Item["num"]; ?></td>
                    <td class="w3" nowrap align="center"><?php echo $Item["ysje"]; ?></td>
                    <td class="w4" nowrap align="center"><?php echo $Item["zyf"]; ?></td>
                    <td class="w5" nowrap align="center"><?php echo $Item["bfyk"]; ?></td>
                 </tr>         
            <?php } }?>
        </table>
    </div>   
<script type="text/javascript">
    $('#cvs-button').click(function(){
        var dateinbegin = $("#dateinbegin").val();
        var dateinend = $("#dateinend").val();
        location.href='/admini/manageday/buyshopcount/export/csv/dateinbegin/'+dateinbegin+'/dateinend/'+dateinend;
    });
</script>